Technical Field
The present disclosure relates to a slave device and a method for controlling the same.
Description of the Related Art
Typically, in a network with a number of devices connected thereto, the devices may be divided into a master device and slave devices. The master device monitors operation of slave devices or transmits instructions or data required by the slave devices. In general, when a network includes a large number of slave devices, a master device transmits a control message to each of the slave devices to control them.
FIG. 1 is a diagram illustrating a data transmission scheme between a master device and slave devices in the related art. Referring to FIG. 1, a master device M generates as many control messages as slave devices existing in the network. Then, the master device M transmits the generated control messages to the slave devices S1 to S4, respectively. The slave devices S1 to S4 apply there to the received control messages from the master device M or transmit input data to the master device M as requested.
In doing so, in order to control the slave devices S1 to S4, the master device M has to generate as many control messages as the slave devices S1 to S4 in the network and transmits them to the slave devices S1 to S4, respectively.
However, according to this scheme, there is a problem in that data traffic increases as the number of slave devices increases and in turn the number of control messages increases. As a result, data transmission time increases and thus it becomes difficult to control the slave devices in real-time.
To overcome this problem, there has been proposed a data transmission scheme using the EtherCAT communications.
FIG. 2 is a diagram illustrating a data transmission scheme using the EtherCAT communications in the related art. Referring to FIG. 2, in order to control slave devices S1 to S4 in a network, a master device M packages output data items S1_In, S2_In, S3_In and S4_In each having a fixed size into a single control message to transmit it to the slave devices S1 to S4, respectively. Then, the master device M transmits the generated control message to the slave device S1.
In the EtherCAT communications architecture shown in FIG. 2, the slave device. S1 transmits the control message received from the master device M to the slave device S2 in a cut-through manner, and likewise the slave device S2 transmits the received control message to the slave device S3, and so on. The cut-through manner refers to a technique that a received message is transmitted as soon as the destination of the message is determined to thereby reduce standby time of the message.
Initially, the slave device S1 receives a control message from the master device M, and extracts input data S1_In from the first field of the control message that is associated with the slave device S1. Subsequently, the slave device S1 writes output data S1_Out in the first field of the control message to transmit it to the slave device S2.
The slave device S2, upon receiving the control message from the slave device S1, extracts input data S2_In from the second field of the control message that is associated with the slave device S2. Then, the slave device S2 writes output data S2_Out in the second field of the control message to transmit it to the slave device S3.
The slave device S3, upon receiving the control message from the slave device S2, extracts input data S3_In from the third field of the control message that is associated with the slave device S3 to apply it thereto. Then, the slave device S3 writes output data S3_Out in the third field of the control message to transmit it to the slave device S4.
The slave device S4, upon receiving the control message from the slave device S3, extracts input data S4_In from the fourth field of the control message that is associated with the slave device S4 to apply it thereto. Then, the slave device S4 writes output data S4_Out in the fourth field of the control message to transmit it to the master device M.
The master device M may determine whether the slave devices S1 to S4 are operating normally based on the output data S1_Out, S2_Out, S3_Out and S4_Out, respectively, included in the received control message from the slave device S4.
According to the data transmission scheme using the EtherCAT communications as described above with referring to FIG. 2, the master device M only has to generate a single control message regardless of the number of the slave devices S1 to S4. Therefore, the problem of the scheme described above with reference to FIG. 1, i.e., increase in data traffic can be addressed. Further, according to the data transmission scheme using the EtherCAT communications as described above with referring to FIG. 2, the data transmission time can be reduced via the hardware switching manner, i.e., the cut-through manner.
Unfortunately, the slave devices S1 to S4 cannot transmit other control messages while a control message is transmitted therebetween, in order to avoid data collision.
In addition, the control message generated by the master device M has fields of fixed sizes in which input data of each of the slave devices S1 to S4 is stored, such that the size of data to be transmitted is limited. Further, for a network including a larger number of slave devices, the size of the data fields allocated to each of the slave devices decreases.
Furthermore, as the number of the slave devices increases, the transmission delay of the control message increases linearly, such that it becomes difficult to control the slave devices in real-time.